import { AxiosRequestConfig } from "axios";
import { Request } from "./base";

enum ContentTypeEnum {
  "application/json;charset=UTF-8",
  "application/x-www-form-urlencoded;charset=UTF-8",
  "multipart/form-data;charset=UTF-8",
}
export interface multiConfig extends AxiosRequestConfig {
  needOrigin?: boolean;
  portType?: string;
}
export const cafReq = (headerType: number, config?: multiConfig) => {
  return new Request(
    Object.assign({ "Content-Type": ContentTypeEnum[headerType] }, config)
  );
};
